SET SERVICE_NAME=nacos
SET IMAGE_NAME=nacos/nacos-server
SET VERSION=v2.3.0
SET MODE=standalone
SET PORT1=8848
SET PORT2=9848
SET PORT3=9555
SET MYSQL_SERVICE_PORT=3306
SET MYSQL_SERVICE_DB_NAME=nacos
SET MYSQL_SERVICE_USER=nacos
SET MYSQL_SERVICE_PASSWORD=nacos2024
SET MYSQL_DATABASE_NUM=1
SET MYSQL_SERVICE_DB_PARAM="characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true"
SET NACOS_AUTH_ENABLE=true
SET NACOS_AUTH_IDENTITY_KEY=ggs
SET NACOS_AUTH_IDENTITY_VALUE=ggs2024
SET NACOS_AUTH_TOKEN=YmJ0c2JidHNiYnRzYmJ0c2JidHNiYnRzYmJ0c2JidHMK
SET DIR=/c/home/app/docker/%SERVICE_NAME%

docker stop %SERVICE_NAME%
docker rm %SERVICE_NAME%
docker run --name %SERVICE_NAME% -d ^
-p %PORT1%:%PORT1% ^
-p %PORT2%:%PORT2% ^
-p %PORT3%:%PORT3% ^
-e MODE=%MODE% ^
-e PREFER_HOST_MODE=hostname ^
-e SPRING_DATASOURCE_PLATFORM=mysql ^
-e MYSQL_SERVICE_HOST=mysql ^
-e MYSQL_SERVICE_PORT=%MYSQL_SERVICE_PORT% ^
-e MYSQL_SERVICE_DB_NAME=%MYSQL_SERVICE_DB_NAME% ^
-e MYSQL_SERVICE_USER=%MYSQL_SERVICE_USER%% ^
-e MYSQL_SERVICE_PASSWORD=%MYSQL_SERVICE_PASSWORD% ^
-e MYSQL_DATABASE_NUM=%MYSQL_DATABASE_NUM% ^
-e MYSQL_SERVICE_DB_PARAM=%MYSQL_SERVICE_DB_PARAM% ^
-e NACOS_AUTH_ENABLE=%NACOS_AUTH_ENABLE% ^
-e NACOS_AUTH_IDENTITY_KEY=%NACOS_AUTH_IDENTITY_KEY% ^
-e NACOS_AUTH_IDENTITY_VALUE=%NACOS_AUTH_IDENTITY_VALUE% ^
-e NACOS_AUTH_TOKEN=%NACOS_AUTH_TOKEN% ^
-v %DIR%/logs:/home/nacos/logs ^
--link mysql:mysql --restart always %IMAGE_NAME%:%VERSION%